<template>
	<view>
		<view style="margin: 0 auto;padding: 25rpx;text-align: center;">
			<text class="title">{{article.name}}</text>
		</view>
		<view class="detail_content" v-html="content"></view>
	</view>
</template>

<script>
	import mpHtml from "@/components/mp-html/components/mp-html/mp-html.vue"
	import {
		useStore
	} from "vuex";
	import *  as artical from "@/api/article";

	import {
		defineComponent
	} from "vue";
	export default {
		data() {
			return {
				title: '',
				article:{},
				content:'',
			}
		},
		onLoad(option) { 
			this.getArticleDetail(option.id);
		},
		methods:{
			getArticleDetail(id){
				artical.getArticleInfo(id).then((res)=>{
					this.article = res.data;
					this.content = res.data.content.replace('<img','<img style="width:100%; transform: translateX(-2em);"');
				});
			}
		}
	}
</script>

<style scoped>
	.title {
		font-size: 42rpx;
		font-weight: 700;
	}
	
	.detail_content {
		text-indent: 2em;
		line-height: 50rpx;
		padding: 25rpx;
	}
</style>